var express = require('express');
var router = express.Router();
var menuController = require('../controllers/menuController')
var passport=require('passport');
/* GET home page. */
//TOP榜单
router.get('/top', function (req, res, next) {
    menuController.getAllTop(req,res)
});

//榜单详情
router.get('/detail/:mealId', function (req, res, next) {
    menuController.getTopDetail(req,res)
});

//文章标题图片
router.get('/people', function (req, res, next) {
    menuController.getPeople(req,res)
});

//文章具体内容
router.get('/peopledetail/:peopleId', function (req, res, next) {
    menuController.getPeopleDetail(req,res)
});

router.get('/selmenulike/:mealId',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    menuController.selmenulike(req,res)
});

router.post('/addlike',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    menuController.addLikeNum(req,res)
});

//取消套餐点赞
router.put('/dellike',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    menuController.delLikeNum(req,res)
});
module.exports = router;
